<?php
include_once 'common/tools.php';

$videoId = $_GET["videoId"];
@ $userId = $_GET["id"];
$userIp = $_SERVER["REMOTE_ADDR"];
$userMac = $_GET["mac"];

$config = require 'conf/config.ini.php'; //加载公用config.ini.php
$conn = mysql_connect($config["DB_HOST"], $config["DB_USER"], $config["DB_PWD"]);
mysql_select_db($config["DB_NAME"], $conn);
mysql_query("SET NAMES utf8");

if ($userId == "null") {
	$userId = null;
}

//记录观看比赛者信息
$sql_watch = "insert into live_video_watch (videoId,userId,userIp,userMac) values ('" . $videoId . "', '" . $userId . "', '" . $userIp . "', '" . $userMac . "')";
mysql_query("SET NAMES gbk");
mysql_query($sql_watch, $conn);
?>